package online.shenjian.kafka;

import lombok.Data;

@Data
public class Transaction {
  private String transactionId;
  private String customerId;
  private Double amount;
  private Long timestamp;

  public Transaction() {}

  public Transaction(String transactionId, String customerId, Double amount, Long timestamp) {
    this.transactionId = transactionId;
    this.customerId = customerId;
    this.amount = amount;
    this.timestamp = timestamp;
  }

  public Transaction withAmount(Double amount) {
    return new Transaction(transactionId, customerId, amount, timestamp);
  }
}
